package team.tunan.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @author : wex
 * @createTime : 2024/1/3 17:24
 */

@Configuration
public class MultipartResolverConfig {
    @Bean(name = "multipartResolver")
    public CommonsMultipartResolver getCommonsMultipartResolver() {
        CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();

        multipartResolver.setMaxUploadSize(2097152);//314572800
        multipartResolver.setMaxUploadSizePerFile(2097152);//104857600
        multipartResolver.setMaxInMemorySize(2048);
        return multipartResolver;
    }
}
